/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
* @description /
* @author shitou
* @date 2024-04-21
**/
@Data
@TableName("teach")
public class Teach implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "状态")
    private Integer state;

    @ApiModelProperty(value = "排序")
    private Integer orderby;

    @ApiModelProperty(value = "创作人")
    private Long userid;

    @TableField(exist = false)
    private String username;

    @ApiModelProperty(value = "创建时间")
    private String createtime;

    @ApiModelProperty(value = "操作时间")
    private Long lastupdatetime;

    @ApiModelProperty(value = "教材分类")
    private Integer teachtypeid;

    @ApiModelProperty(value = "作者")
    private String author;

    @ApiModelProperty(value = "出版社")
    private String press;

    @ApiModelProperty(value = "出版号")
    private String pressnum;

    @ApiModelProperty(value = "教材协作者")
    private String textbookcollaborator;

    @ApiModelProperty(value = "教材描述")
    private String info;

    @TableField(exist = false)
    private Long teachTid;

    @TableField(exist = false)
    private List<Long> teacherIds;

    @TableField(exist = false)
    private String teachtypename;

    private Integer isOpen;

    private Integer isAudit;

    private String rejectReason;

    //出版地
    private String location;

    //出版时间
    private String publicTime;

    //责任编辑
    private String editorInChief;

    @TableField(exist = false)
    private Float progress;

    @TableField(exist = false)
    private Integer clazzTeachId;

    @TableField(exist = false)
    private List<Teacher> teacherList;

    public void copy(Teach source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
